package com.xueyi.aixihu.reqeust;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author hxs
 * @createDate 2023/7/15 9:33 上午
 * @description 修改报表信息
 */
@Data
public class UpdateReportFormInfoReq {
    /**
     * 报表标题
     */
    @NotBlank(message = "请输入报表标题")
    @Length(max = 255, message = "标题太长了~~~")
    private String financeTitle;

    /**
     * 创建时间
     */
    @NotBlank(message = "请选择时间")
    private String createTime;

    /**
     * 分类
     */
    @NotNull(message = "请选择分类")
    private Integer systemTypeId;

    /**
     * 报表id
     */
    @NotNull(message = "参数异常")
    private Integer id;

    public void format() {
        financeTitle = StringUtils.hasLength(financeTitle) ? financeTitle.trim() : null;
        createTime = StringUtils.hasLength(createTime) ? createTime.trim() : null;
    }
}
